<template>
  <div>
    <!-- <el-button>默认按钮</el-button> -->
    <button size="large" type="text" @click="backHome">返回首页</button>
    <button size="large" type="text">返回上一页({{ second }}s)</button>
  </div>
</template>

<script>
import './error.less'
export default {
  name: 'backBtnGroup',
  data () {
    return {
      second: 5,
      timer: null
    }
  },
  methods: {
    backHome () {
      this.$router.push({path:'/'})
    },
    backPrev () {
      this.$router.go(-1);
    }
  },
  // mounted () {
  //   this.timer = setInterval(() => {
  //     if (this.second === 0) this.backPrev()
  //     else this.second--
  //   }, 1000)
  // },
  // beforeDestroy () {
  //   clearInterval(this.timer)
  // }
}
</script>
